//
//  ZHCollectionViewHelper.h
//  ArthurRoom
//
//  Created by 赵宏亚 on 2019/8/16.
//  Copyright © 2019 ArthurRoom. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <ReactiveObjC.h>
#import "ZHCellDelegate.h"

NS_ASSUME_NONNULL_BEGIN

typedef NS_ENUM(NSInteger, ZHCollectionViewCellType) {
    cellTypeMovie = 1,
    cellTypeNovel = 2
};

@interface ZHCollectionViewHelper : NSObject<UICollectionViewDataSource, UICollectionViewDelegate>

@property (nonatomic,strong) NSMutableArray *data;
@property (nonatomic,strong) UICollectionView *collectionView;
@property (nonatomic,strong) UICollectionViewCell *templateCell;
@property (nonatomic,strong) RACCommand *selectCommand;
@property (nonatomic,assign) ZHCollectionViewCellType cellType; // cell类型



/**
 初始化collectionView

 @param collectionView 要绑定的collectionView
 @param source 传过来的数据
 @param command 传过来的command
 @param classCell 定义的cell
 @return 返回helper
 */
+ (instancetype)bindWithCollectionView:(UICollectionView *)collectionView
                            dataSource:(RACSignal *)source
                      selectionCommand:(RACCommand *)command
                 templateCellClassName:(NSString *)classCell;

+ (instancetype)bindWithCollectionView:(UICollectionView *)collectionView
                            dataSource:(RACSignal *)source
                      selectionCommand:(RACCommand *)command
                          templateCell:(UINib *)nibCell;


/**
 刷新数据
 
 @param source 最新的数据
 */
- (void)reloadDataWithSourceList:(NSArray *)source;

@end




NS_ASSUME_NONNULL_END
